<template>
	<div id="app">
		<keep-alive include="index">
			<router-view />
		</keep-alive>

		<myfooter></myfooter>
	</div>
</template>
<script>
import Myfooter from "@/components/footer.vue";
import { apicensussetvisit } from "@/network/request";

export default {
	name: "app",
	components: {
		Myfooter,
	},
	created() {
		this.setblognumber();
	},
	methods: {
		setblognumber() {
			let date = new Date();
			let years_month = date.getFullYear() + "-" + (date.getMonth() + 1);
			const open_my_blog = window.sessionStorage.getItem("open_my_blog");
			if (!open_my_blog) {
				apicensussetvisit({ years_month }).then((res) => {
					if (res.status == 200) {
						window.sessionStorage.setItem("open_my_blog", true);
					}
				});
			}
		},
	},
};
</script>

<style lang="scss">
@import "@/assets/css/reset.css";
</style>
